Telegram Group & Telegram Channel
ℹ️ Как компьютеры находят простые числа в тысячи раз быстрее, чем ты на бумажке

📌 Что делает решето Эратосфена

Находит все простые числа от 1 до N — быстро, эффективно и без перебора делителей.

➡️ Как это работает

▪️ Создаём массив от 2 до N

▪️ Берём первое невычеркнутое число p

▪️ Вычеркиваем все кратные p

▪️ Переходим к следующему невычеркнутому числу

▪️ Повторяем, пока p² <= N

Пример на Python:
def eratosthenes(n):
sieve = [True] * (n+1)
sieve[0:2] = [False, False]
for i in range(2, int(n**0.5) + 1):
if sieve[i]:
for j in range(i*i, n+1, i):
sieve[j] = False
return [i for i, prime in enumerate(sieve) if prime]


🔵 Чтобы знать об алгоритмах все, забирайте наш курс «Алгоритмы и структуры данных»

Proglib Academy #буст
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/proglib_academy/2771
Create:
Last Update:

ℹ️ Как компьютеры находят простые числа в тысячи раз быстрее, чем ты на бумажке

📌 Что делает решето Эратосфена

Находит все простые числа от 1 до N — быстро, эффективно и без перебора делителей.

➡️ Как это работает

▪️ Создаём массив от 2 до N

▪️ Берём первое невычеркнутое число p

▪️ Вычеркиваем все кратные p

▪️ Переходим к следующему невычеркнутому числу

▪️ Повторяем, пока p² <= N

Пример на Python:

def eratosthenes(n):
sieve = [True] * (n+1)
sieve[0:2] = [False, False]
for i in range(2, int(n**0.5) + 1):
if sieve[i]:
for j in range(i*i, n+1, i):
sieve[j] = False
return [i for i, prime in enumerate(sieve) if prime]


🔵 Чтобы знать об алгоритмах все, забирайте наш курс «Алгоритмы и структуры данных»

Proglib Academy #буст

BY Proglib.academy | IT-курсы




Share with your friend now:
tg-me.com/proglib_academy/2771

View MORE
Open in Telegram


Proglib academy | IT курсы Telegram | DID YOU KNOW?

Date: |

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

Telegram announces Anonymous Admins

The cloud-based messaging platform is also adding Anonymous Group Admins feature. As per Telegram, this feature is being introduced for safer protests. As per the Telegram blog post, users can “Toggle Remain Anonymous in Admin rights to enable Batman mode. The anonymized admin will be hidden in the list of group members, and their messages in the chat will be signed with the group name, similar to channel posts.”

Proglib academy | IT курсы from in


Telegram Proglib.academy | IT-курсы
FROM USA